<template>
  <div>
    <transition name="router-fade" mode="out-in">
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive"></router-view>
      </keep-alive>
    </transition>
    <transition name="router-fade" mode="out-in">
      <router-view v-if="!$route.meta.keepAlive"></router-view>
    </transition>
    <svg-icon></svg-icon>
  </div>
</template>

<script>
import { test } from "./service/getData";
import svgIcon from "./components/common/svg";
import axios from "axios";
import { setStore, getStore } from "./config/mUtils.js";
export default {
  components: {
    svgIcon
  },
  created() {
    let uid =
      window.location.href.split("?uid=")[1].split("#")[0] ||
      window.location.href.split("?uid=")[1];
    this.$store.state.uid = uid ? uid : getStore("uid");
    if (uid) setStore("uid", uid);
    if (this.$store.state.uid && this.$route.name == "msite") {
      this.$store.state.comeType = 1;
    } else if (this.$store.state.uid && this.$route.name == "profile") {
      this.$store.state.comeType = 2;
    }
  }
};
</script>

<style lang="scss">
@import "./style/common";
.router-fade-enter-active,
.router-fade-leave-active {
  transition: opacity 0.3s;
}
.router-fade-enter,
.router-fade-leave-active {
  opacity: 0;
}
</style>
